$Extract_1 = 'enc_fhgaac.dll libmp4v2.dll nsutil.dll'

; Handle 7-zip
If FileExists( @ScriptDir & '\7z.exe' ) Then
	$Path_7zip = @ScriptDir & '\'
Else
	If @OSArch = 'X86' Then 
		$Path_7zip = RegRead( 'HKLM\SOFTWARE\7-Zip' , 'Path' )
	Else
		$Path_7zip = RegRead( 'HKLM64\SOFTWARE\7-Zip' , 'Path' )
	EndIf
	If StringRight( $Path_7zip , 1 ) <> '\' Then $Path_7zip &= '\'
	If $Path_7zip = '' OR FileExists( $Path_7zip & '7z.exe' ) = 0 Then
		While 1
			$7zip = FileOpenDialog( 'Select 7-zip Executable.' , '' , 'Executables (*.exe)' , 1 + 4 )
			If @Error Then
				MsgBox( 4096 , 'Error:' , 'No Executable Chosen.' )
				Exit
			Else
				$Path_7zip = StringLeft( $7zip , StringInStr ( $7zip , '\' , 0 , -1 ) - 1 )
				If FileExists( $Path_7zip & '7z.exe' ) Then ExitLoop
				MsgBox( 4096 , 'Error:' , '7z.exe Not Present.' )
				Exit
			EndIf
		WEnd
	EndIf
EndIf

; Handle Installers
$Installer = ''
$search = FileFindFirstFile( @ScriptDir & '\winamp*.exe' )
If NOT @Error Then
	$Installer = @ScriptDir & '\' & FileFindNextFile( $search )
EndIf
If $Installer = '' Then
	$Installer = FileOpenDialog( 'Select WinAMP Installer.' , '' , 'Executables (*.exe)' , 1 + 4 )
	If @Error Then
		MsgBox( 4096 , 'Error:' , 'No Installer Chosen.' )
		Exit
	EndIf
EndIf
; Start Extracting Files
RunWait( @ComSpec & ' /c 7z.exe e -y -r -o"' & @ScriptDir & '" "' & $Installer & '" ' & $Extract_1 , $Path_7zip , @SW_HIDE )

MsgBox( 0 , 'Finished' , 'All files Processed.' )
